#ifndef SL_WINDOWSETTINGS_HPP
#define SL_WINDOWSETTINGS_HPP

// std Header
#include <string>

// SFML Header
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

// pugi Header
#include <pugixml.hpp>

// Eigene Header
#include "../System/Pointer.hpp"
#include "../System/Operator.hpp"
#include "../System/Convert.hpp"

namespace sl
{
	class WindowSettings : public Operator<WindowSettings>
	{
	friend class Operator<WindowSettings>;

	public:
		WindowSettings();
		WindowSettings(sf::VideoMode mode, const std::string& caption, char style, const sf::ContextSettings& settings);

	protected:
		sf::VideoMode myMode;
		char myStyle;
		sf::ContextSettings mySettings;
		std::string myCaption;
		bool myFullscreen;

	public:
		WindowSettings* Create(sf::VideoMode mode, const std::string& caption, char style, const sf::ContextSettings& settings);
		sf::VideoMode GetMode();
		WindowSettings* SetMode(const sf::VideoMode& videomode);
		short GetStyle();
		WindowSettings* SetStyle(char style);
		sf::ContextSettings GetSettings();
		WindowSettings* SetSettings(const sf::ContextSettings& settings);
		std::string GetCaption();
		WindowSettings* SetCaption(const std::string& caption);
		bool GetFullscreen();
		WindowSettings* SetFullscreen(bool fullscreen);

		WindowSettings* LoadFromFile(const pugi::xml_node* node);
		WindowSettings* SaveToFile(const std::string& filename);
		WindowSettings* SaveToFile(pugi::xml_node* node, const std::string& filename);

	public:
		friend std::ostream& operator<<(std::ostream& os, const WindowSettings& settings);
		friend std::istream& operator>>(std::istream& is, WindowSettings& settings);
	};
}

#endif //SL_WINDOWSETTINGS_HPP